package com.vchello.service.impl.lib;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.vchello.bean.lib.Area;
import com.vchello.dao.lib.AreaDao;
import com.vchello.service.lib.AreaService;

@Service(value = "areaService")
public class AreaServiceImpl extends ServiceImpl<AreaDao, Area> implements AreaService{

	@Autowired
	private AreaDao areaDao;

	@Override
	public List<Area> findAll() {
		return areaDao.selectList(new EntityWrapper<Area>());
	}

	@Override
	public List<Area> searchArea(String keyWord) {
		Wrapper<Area> wrapper = new EntityWrapper<Area>();
		wrapper.like("name", keyWord);
		return areaDao.selectList(wrapper);
	}

	@Override
	public Integer saveArea(Area area) {
		return areaDao.insert(area);
	}

}
